package cate.game.event;

import cate.game.GameBody;
import cate.game.play.support.PlayBuildContext;

public interface EventPublisher {
    default void publishEvent(GameBody gameBody, GameEvent gameEvent){
        gameBody.eventDispatcher.dispatchEvent(gameEvent);
    }

    default void publishEvent(PlayBuildContext pbc, GameEvent gameEvent){
        GameEventDispatcher d = pbc.gameEventDispatcher();
        if(d != null) {
            d.dispatchEvent(gameEvent);
        }
    }
}
